//
//  UIImageView+YDYExtension.m
//  DYSisterAPP
//
//  Created by 杨德勇 on 2016/8/9.
//  Copyright © 2016年 杨德勇. All rights reserved.
//

#import "UIImageView+YDYExtension.h"

@implementation UIImageView (YDYExtension)
/** aaa**/
-(void)ydy_setCircleHeader:(NSString *)url PlaceHolderImage:(UIImage *)placeHolderImage{
    //把占位图片变成圆的
    UIImage *placeImg = [placeHolderImage ydy_circleImage];
    
    [self sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:placeImg completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
        //网络请求错误的时候，就不用做下面的代码了
        if (!image)return ;
        //把图片处理成圆的
        self.image = [image ydy_circleImage];
        
    }];
    
}
@end
